package org.cy.spring.learning.proxy.jdk.dynamic;

import lombok.extern.slf4j.Slf4j;

import java.lang.reflect.Proxy;

/**
 * JDK 动态代理
 *
 * create date: 2019/10/18 13:56
 *
 * @author cao.yong
 */
@Slf4j
public class DynamicProxyFactory {

    public Object getProxyInstance(Object target) {
        return Proxy.newProxyInstance(target.getClass().getClassLoader(),
                target.getClass().getInterfaces(), new DynamicInvocationHandler(target));
    }
}
